<!DOCTYPE html>
<!-- saved from url=(0042)https://sc.myuserhub.com/portal/pswdchange -->
<html>
{include file="public/head"}
<body>
{include file="public/nav"}

<!--<div class="container">-->
<div class="rowHeader">
    <div class="container">
        <div class="row">
            <div class="col-lg-6 col-md-6" style="text-align:left">
                <h1>

                    欢迎 <span class="userName">{$UserInfo.username}</span>

                    <span class="label label-success lb-sm" style="vertical-align: middle;">通过审核</span>

                </h1>
            </div>
            <!--End collumn-->

            <div class="col-lg-6 col-md-6 pageTitleRight">
                <h1 class="pull-right">充值</h1>
            </div>
            <!--End collumn-->

        </div>
        <!--End Row-->
    </div>
    <!--End container-->
</div>
<!--End Row-->

<div class="container">
    <div class="row mainRow">

        <!--菜单栏-->
        {include file="public/menu"}
        <!--End column-->
        <div class="col-lg-8 col-md-9 col-sm-9 mainContent">

            <div class="panel panel-default">

                <nav class="navbar" id="navAccount">
                    <div>
                        <div class="navbar-header">
                            <button id="navAccountButton" type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbarAccount" aria-expanded="false" aria-controls="navbar">
                                <span id="navAccountButtonText"></span>
                                <span><i class="fa fa-bars" aria-hidden="true"></i></span>
                            </button>
                        </div>

                        <div id="navbarAccount" class="collapse navbar-collapse">
                            <ul class="nav nav-tabs nav-justified">
                                <li role="presentation"><a href="{:url('Finance/FinanceList')}">交易历史</a></li>
<!--                                <li role="presentation"><a href="/liveaccount/ledgerreport/account/8033126/page/0">账户报告</a></li>-->
                                <li role="presentation" class="active"><a href="{:url('Assets/Recharge')}">存款</a></li>
                                <li role="presentation"><a href="{:url('Assets/AssetsWithdraw')}">取款</a></li>
                            </ul>
                        </div>
                    </div>
                </nav>


                <div class="headingDeposit">
                    <br>
                    <!--<h1>银行转帐</h1>-->
                    <ul class="nav nav-pills nav-justified navPayments">
                        <li role="presentation" class="active"><a href="#epaymentsTab" aria-controls="epaymentsTab" role="pill" data-toggle="pill">充值</a></li>

                        <li role="presentation"><a href="{:url('Assets/AssetsTransfer')}">内部转账</a></li>
                    </ul>
                </div><!--End Heading-->

                <br>

                <div class="tab-content">

                    <div role="tabpanel" class="tab-pane fade in active" id="epaymentsTab">

                        <div class="alert alert-warning alert-dismissible fade in">
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                            <h4>重要通知</h4>
                            <p></p>
                        </div>

                        <p class="text-center">充值 <b></b></p>


                        <div class="panel panel-warning">
                            <form method="post">
                                <div class="form-group" id="">
                                    <label class="col-lg-4 col-md-4 control-label" for="">充值地址 <span
                                            class="redStar">*</span></label>
                                    <div class="col-lg-8 col-md-8">
                                        <input type="text" name="" class="form-control"
                                               placeholder="" value="{$Config.usdt_address}" readonly disabled>
                                        <span class="help-block helpBlockOldPassword"></span>
                                    </div>
                                    <!--End column-->
                                </div>
                                <div class="form-group" id="groupOldPassword">
                                    <label class="col-lg-4 col-md-4 control-label" for="num">充值金额 <span
                                            class="redStar">*</span></label>
                                    <div class="col-lg-8 col-md-8">
                                        <input type="text" id="num" name="num" class="form-control"
                                               placeholder="输入充值金额" onkeyup="this.value= this.value.match(/\d+(\.\d{0,2})?/) ? this.value.match(/\d+(\.\d{0,2})?/)[0] : ''">
                                        <span class="help-block helpBlockOldPassword"></span>
                                    </div>
                                    <!--End column-->
                                </div>
                                <div class="panel-heading">请上传转账凭证 </div>
                                <div class="panel-body">
                                    <label for="upload">
                                        <a class="btn btn-default btnWhiteWithBlue"> 请上传转账凭证</a>
                                        <input type="file" id="upload" style="display: none">
                                        <input type="hidden" name="hash" id="hash">
                                    </label>
                                    <img src="" id="img_show" alt="">
                                </div><!--End panel body-->
                                <div class="form-group" style="text-align: right">
                                    <button type="submit" id="recharge" class="btn btn-primary greenBtn" style="margin-right: 15px;">提交 </button>
                                </div>

                            </form>

                        </div><!--End panel-->


                    </div><!--End tab epaymentsTab-->


                    <div role="tabpanel" class="tab-pane fade" id="otherTab">

                        <p class="text-center">此国家可用 其他方式： <b>CHINA</b></p>

                    </div><!--End tab other-->

                </div><!--End tab-content-->


            </div><!--End panel-->

        </div>
        <!--End column-->

    </div>
    <!--End row-->
</div>
<!--End container-->

{include file="public/foot"}
</body>
<script>
    //ajax异步图片上传
    $('#upload').change(function(){
        //图片对象
        let that = $(this);
        var formData = new FormData();
        formData.append("image", that[0].files[0]);

        // 上传设置
        $.ajax({
            // 规定把请求发送到那个URL
            url: "{:url('Assets/forUpload')}",
            type: "post",            // 请求方式
            dtaType: 'json',
            data: formData,//传值就传fd对象了
            processData:false,  //告诉jQuery不要处理数据
            contentType: false,  //告诉jQuery不要设置contentType
            // 请求成功时执行的回调函数
            success: function (data) {
                if(data.status == 1)
                {
                    $("#img_show").attr('src',data.message);
                    $("#address").val(data.message);
                }
                else
                {
                    layer.msg(data.message);
                }
            }
        });
    });
    var flag = 1;
    $("#recharge").click(function (e) {
        e.preventDefault();
        if (!flag){
            return  false
        }
        var that = $(this)
        that.attr('disabled',true)
        flag = 0;
        $.ajax({
            type:"post",
            dataType:"json",
            data:$("form").serialize(),
            url:"{:url('Assets/Recharge')}",
            success:function (data) {
                if (data.status == 1){
                    layer.msg(data.message,{time:1500},function () {
                        window.location.reload()
                    })
                }else {
                    layer.msg(data.message,{time:1500},function () {
                        that.removeAttr('disabled')
                        flag = 1;
                    })

                }
            }
        })
    })
</script>
</html>
